/**
 * 作者: lipengfei
 * 日期: 2021-12-23 19:41:37
 * 备注: 充值项表
 */
package com.motu.monstercity.module.common.iap;

import io.vertx.core.json.JsonObject;

public class IapModel {
	protected int id; // 充值项id
	protected String name; // 名称
	protected double money; // 人民币金额
	protected int freeItemId; // 免费代金券道具id
	protected int payItemId; // 付费代金券道具id
	protected double moneyEn; // 美金金额
	protected int score; // vip充值积分
	protected String costTokens; // 各地区充值代币数量 ({"cn":6,"ko":15})

	public IapModel() {
	}

	public IapModel(JsonObject obj) {
		id = obj.containsKey("id") ? obj.getInteger("id") : 0;
		name = obj.containsKey("name") ? obj.getString("name") : "";
		money = obj.containsKey("money") ? obj.getDouble("money") : 0;
		freeItemId = obj.containsKey("free_item_id") ? obj.getInteger("free_item_id") : 0;
		payItemId = obj.containsKey("pay_item_id") ? obj.getInteger("pay_item_id") : 0;
		moneyEn = obj.containsKey("money_en") ? obj.getDouble("money_en") : 0;
		score = obj.containsKey("score") ? obj.getInteger("score") : 0;
		costTokens = obj.containsKey("cost_tokens") ? obj.getString("cost_tokens") : "";
	}

	public int getId() {
		return id;
	}

	public String getName() {
		return name;
	}

	public double getMoney() {
		return money;
	}

	public int getFreeItemId() {
		return freeItemId;
	}

	public int getPayItemId() {
		return payItemId;
	}

	public double getMoneyEn() {
		return moneyEn;
	}

	public int getScore() {
		return score;
	}

	public String getCostTokens() {
		return costTokens;
	}

}
